home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / sbin_-_Static_Binary_Files / LILOCONF.{12 < prev    next >
Text File  |  1999-09-17  |  34KB  |  1,135 lines

  1. #!/bin/sh
  2. #
  3. # Copyright 1994, 1998, 1999 Patrick Volkerding, Moorhead, Minnesota USA
  4. # All rights reserved.
  5. #
  6. # Redistribution and use of this script, with or without modification, is
  7. # permitted provided that the following conditions are met:
  8. #
  9. # 1. Redistributions of this script must retain the above copyright
  10. #    notice, this list of conditions and the following disclaimer.
  11. #
  12. #  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
  13. #  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
  15. #  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. #  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  17. #  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  18. #  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  19. #  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  20. #  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  21. #  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22. #
  23. TMP=/var/log/setup/tmp
  24. if [ "$COLOR" = "" ]; then
  25.   # Set color menu mode unless we detect that we're on the text.gz disk:
  26.   if [ ! -r /usr/lib/setup/setup.tty ]; then
  27.     COLOR=on
  28.   fi
  29. fi
  30. # This is a different 'probe' than the function below.
  31. if [ -x /sbin/probe ]; then
  32.  PROBE=/sbin/probe
  33. else
  34.  PROBE=/sbin/fdisk
  35. fi
  36.  
  37. # This function scans for bootable partitions (making some assumptions along
  38. # the way which may or may not be correct, but usually work), and sets up
  39. # LILO in either the superblock, or the MBR.
  40. simplelilo()
  41. {
  42.  if $PROBE -l | fgrep 'OS/2 Boot Manager' 1> /dev/null 2> /dev/null ; then
  43.   dialog --title "OS/2 BOOT MANAGER FOUND" --yesno \
  44.   "Your system appears to have Boot Manager, a boot menu system provided \
  45.   with OS/2 and Partition Magic.  If you like, we can install a very simple \
  46.   LILO boot block at the start of your Linux partition.  Then, you can \
  47.   add the partition to the Boot Manager menu, and you'll be able to use \
  48.   Boot Manager to boot Linux.  Would you like to install LILO in a Boot \
  49.   Manager compatible way?" 11 65
  50.   FLAG=$?
  51.   if [ ! $FLAG = 0 -a ! $FLAG = 1 ]; then
  52.    exit 1
  53.   fi
  54.   if [ $FLAG = 0 ]; then # yes, use BM
  55.    if [ -r $T_PX/etc/lilo.conf ]; then
  56.     mv $T_PX/etc/lilo.conf $T_PX/etc/lilo.conf.orig
  57.    fi
  58.    cat << EOF > $T_PX/etc/lilo.conf
  59. # LILO configuration file
  60. # generated by 'liloconfig'
  61. #
  62. # Start LILO global section
  63. boot = $ROOT_DEVICE
  64. #delay = 5
  65. vga = normal
  66. # End LILO global section
  67. # Linux root partition section
  68. image = /vmlinuz
  69.  root = $ROOT_DEVICE
  70.  label = Linux
  71.  read-only
  72. # End root Linux partition section
  73. EOF
  74.    dialog --infobox "\nInstalling the Linux Loader..." 5 40
  75.    if [ "$T_PX" = "/" ]; then
  76.     lilo 1> /dev/null 2> /dev/null
  77.    else
  78.     lilo -r $T_PX -m /boot/map -C /etc/lilo.conf 1> /dev/null 2> /dev/null
  79.    fi
  80.    return
  81.   fi # Use Boot Manager
  82.  fi # Boot Manager detected
  83.  # If we got here, we either don't have boot manager or don't want to use it
  84.  dialog --title "SELECT LILO DESTINATION" --menu \
  85. "LILO can be installed to a variety of places:\n\
  86. \n\
  87.   1. The Master Boot Record of your first hard drive.\n\
  88.   2. The superblock of your root Linux partition.  (which could\n\
  89.      be made the bootable partition with DOS or Linux fdisk, or\n\
  90.      booted with a program like OS/2 Boot Manager)\n\
  91.   3. A formatted floppy disk.\n\
  92. \n\
  93. Options 2 and 3 are the safest, but option 2 does require a little\n\
  94. extra work later (setting the partition bootable with fdisk).\n\
  95. Which option would you like?" \
  96.  20 72 3 \
  97.  "MBR" "Install to Master Boot Record" \
  98.  "Root" "Install to superblock (which must be made bootable)" \
  99.  "Floppy" "Install to a formatted floppy in /dev/fd0 (A:)" 2> $TMP/reply
  100.  if [ $? = 1 -o $? = 255 ]; then
  101.   exit
  102.  fi
  103.  TG="`cat $TMP/reply`"
  104.  rm -r $TMP/reply
  105.  if [ "$TG" = "MBR" ]; then
  106.   if [ -L $T_PX/dev/hda ]; then
  107.    LILO_TARGET="/dev/sda"
  108.   elif probe /dev/hda; then
  109.    CDROM_LINK=`/bin/ls -l $T_PX/dev/cdrom`
  110.    CDROM_LINK=`echo $CDROM_LINK | cut -f 11 -d ' '`
  111.    if [ "$CDROM_LINK" = "/dev/hda" -o "$CDROM_LINK" = "hda" ]; then
  112.      LILO_TARGET="/dev/sda" # It must be sda, if there's a CDROM on hda.
  113.    else
  114.      LILO_TARGET="/dev/hda"
  115.    fi
  116.   elif probe /dev/sda; then
  117.    LILO_TARGET="/dev/sda"
  118.   else
  119.    dialog --msgbox "LILO can't find your first hard drive! Sorry, \
  120.    but LILO is getting /dev/null'ed..." 10 50
  121.    LILO_TARGET="/dev/null"
  122.   fi
  123.  elif [ "$TG" = "Root" ]; then
  124.   LILO_TARGET=`echo $ROOT_DEVICE`
  125.  elif [ "$TG" = "Floppy" ]; then
  126.   LILO_TARGET="/dev/fd0"
  127.  fi
  128.  cat << EOF > $T_PX/boot/boot_message.txt
  129.  
  130. Welcome to the LILO Boot Loader!
  131.  
  132. Please enter the name of the partition you would like to boot
  133. at the prompt below.  The choices are:
  134.  
  135. EOF
  136.  cat << EOF > $T_PX/etc/lilo.conf
  137. # LILO configuration file
  138. # generated by 'liloconfig'
  139. #
  140. # Start LILO global section
  141. boot = $LILO_TARGET
  142. message = /boot/boot_message.txt
  143. prompt
  144. timeout = 1200
  145. vga = normal
  146. # End LILO global section
  147. EOF
  148.  # OK, now let's look for DOS partitions:
  149.  DOSP="`$PROBE -l | fgrep "DOS
  150. Win95"`"
  151.  DOSP="`echo $DOSP | cut -f 1 -d ' '`"
  152.  if [ ! "$DOSP" = "" ]; then
  153.   TABLE="`echo $DOSP | cut -b1-8`"
  154.   cat << EOF >> $T_PX/etc/lilo.conf
  155. # DOS bootable partition config begins
  156. other = $DOSP
  157.   label = DOS
  158.   table = $TABLE
  159. # DOS bootable partition config ends
  160. EOF
  161.   echo "DOS     - DOS or Windows (FAT/FAT32 partition)" >> $T_PX/boot/boot_message.txt
  162.  fi
  163.  # Next, we search for Linux partitions:
  164.  LNXP="`$PROBE -l | fgrep "Linux native"`" 
  165.  LNXP="`echo $LNXP | cut -f 1 -d ' '`"
  166.  if [ ! "$LNXP" = "" ]; then
  167.   cat << EOF >> $T_PX/etc/lilo.conf
  168. # Linux bootable partition config begins
  169. image = /vmlinuz
  170.   root = $ROOT_DEVICE
  171.   label = Linux
  172.   read-only
  173. # Linux bootable partition config ends
  174. EOF
  175.   echo "Linux   - Linux (ext2fs partition)" >> $T_PX/boot/boot_message.txt
  176.  fi
  177.  # OK, hopefully we can remember how to deal with OS/2 :^)
  178.  OS2P="`$PROBE -l | fgrep "HPFS"`"
  179.  OS2P="`echo $OS2P | cut -f 1 -d ' '`"
  180.  if [ ! "$OS2P" = "" ]; then
  181.   TABLE="`echo $OS2P | cut -b1-8`"
  182.   if [ "$TABLE" = "/dev/hda" ]; then
  183.    cat << EOF >> $T_PX/etc/lilo.conf
  184. # OS/2 bootable partition config begins
  185. other = $OS2P
  186.   label = OS2
  187.   table = $TABLE
  188. # OS/2 bootable partition config ends
  189. EOF
  190.   else
  191.     cat << EOF >> $T_PX/etc/lilo.conf
  192. # OS/2 bootable partition config begins
  193. other = $OS2P
  194.   label = OS2
  195.   table = $TABLE
  196.   loader = /boot/os2_d.b
  197.   map-drive = 0x80
  198.    to = 0x81
  199.   map-drive = 0x81
  200.    to = 0x80
  201. # OS/2 bootable partition config ends
  202. EOF
  203.    echo "OS2     - OS/2 Warp (HPFS partition)" >> $T_PX/boot/boot_message.txt
  204.   fi
  205.  fi
  206.  echo >> $T_PX/boot/boot_message.txt
  207.  # Done, now we must install lilo:
  208.  dialog --infobox "\nInstalling the Linux Loader..." 5 40
  209.  if [ "$T_PX" = "/" ]; then
  210.   lilo 1> /dev/null 2> /dev/null
  211.   SUCCESS=$?
  212.  else
  213.   lilo -r $T_PX -m /boot/map -C /etc/lilo.conf 1> /dev/null 2> /dev/null
  214.   SUCCESS=$?
  215.  fi
  216.  if [ ! "$SUCCESS" = "0" ]; then # some LILO error occured
  217.   dialog --title "LILO INSTALL ERROR # $SUCCESS" --msgbox \
  218. "Sorry, but the attempt to install LILO has returned an error, so LILO \
  219. has not been correctly installed.  You'll have to use a bootdisk \
  220. to start your \
  221. machine instead.  It should still be possible to get LILO working by \
  222. editing the /etc/lilo.conf and reinstalling LILO manually.  See the \
  223. LILO man page and documentation in /usr/doc/lilo/ for more help." 11 60
  224.  fi
  225. }
  226.  
  227. checkp_text()
  228. {
  229.  if [ ! -r $1 ]; then
  230.   echo
  231.   echo "I can't find a device named '$1'!"
  232.   echo
  233.   echo -n "Are you sure you want to use this device name [y]es, [n]o? "
  234.   read use_device;
  235.   if [ ! "$use_device" = "y" ]; then
  236.    return 1;
  237.   fi
  238.   return 0;
  239.  fi
  240. }
  241.  
  242. checkp_dialog()
  243. {
  244.  if [ ! -r $1 ]; then
  245.   dialog --title "DEVICE FILE NOT FOUND" --yesno "I can't find a \
  246. device named '$1'. Are you sure you want to use this device \
  247. name?" 7 60
  248.   return $?;
  249.  fi
  250. }
  251.  
  252. # 'probe()' borrowed from LILO QuickInst.
  253. probe()
  254. {
  255.  [ ! -z "`dd if=$1 bs=1 count=1 2>/dev/null | tr '\0' x`" ]
  256.  return
  257. }
  258.  
  259. # liloconfig-color?
  260. if [ "`basename $0`" = "liloconfig-color" ]; then
  261.  COLOR=on
  262. fi
  263. # Figure out if we're installing from the hard drive
  264. if [ -r $TMP/SeTT_PX ]; then
  265.  T_PX="`cat $TMP/SeTT_PX`"
  266. else
  267.  if [ "$T_PX" = "" -a ! "$1" = "" ]; then
  268.   T_PX=$1
  269.  else
  270.   T_PX=/
  271.  fi
  272. fi
  273. HDR="no" # this means the header section of /etc/lilo.conf has not yet
  274.          # been configured
  275. LNX="no" # this means no Linux partition has been defined as bootable
  276.          # through LILO. Both of these must change to "yes" before LILO will
  277.          # install from this script.
  278. # Determine the root partition (such as /dev/hda2)
  279. ROOT_DEVICE=$2
  280. if [ "$ROOT_DEVICE" = "" ]; then
  281.  if [ -r $TMP/SeTrootdev ]; then
  282.   ROOT_DEVICE="`cat $TMP/SeTrootdev`"
  283.  else
  284.   ROOT_DEVICE="`mount | cut -b-10 | sed -n "1 p"`"
  285.  fi
  286. fi
  287. if [ -r $TMP/SeTcolor -o "$COLOR" = "on" ]; then # use color menus, otherwise tty
  288.  # If we're installing from the umsdos.gz rootdisk, suggest skipping LILO:
  289.  if [ ! "$T_PX" = "/" ]; then
  290.    if mount | fgrep " on /mnt " | fgrep umsdos 1> /dev/null 2> /dev/null ; then
  291.      dialog --title "SKIP LILO CONFIGURATION? (RECOMMENDED)" --yesno "Since \
  292.      you are installing to a FAT partition, it's suggested that you do not \
  293.      configure LILO at this time.  (Instead, use your bootdisk.  For booting \
  294.      off the hard drive from MS-DOS, you can use Loadlin.  You'll find \
  295.      Loadlin on your hard drive in \LINUX\ROOT) Skip LILO configuration \
  296.      (highly recommended)?" 10 70
  297.      if [ $? = 0 ]; then
  298.        exit
  299.      fi 
  300.    fi
  301.  fi
  302.  # OK, now let's see if we should automate things:
  303.  dialog --title "INSTALL LILO" --menu "LILO (Linux Loader) is a generic \
  304.  boot loader.  There's a simple installation which tries to automatically \
  305.  set up LILO to boot Linux (also DOS, Windows, and OS/2 if found).  For \
  306.  more advanced users, the expert option offers more control over the \
  307.  installation process.  Since LILO does not work in all cases (and can \
  308.  damage partitions if incorrectly installed), there's the third (safe) \
  309.  option, which is to skip installing LILO for now.  You can always install \
  310.  it later with the 'liloconfig' command.  Which option would you like?" \
  311.  18 67 3 \
  312.  "simple" "Try to install LILO automatically" \
  313.  "expert" "Use expert lilo.conf setup menu" \
  314.  "skip" "Do not install LILO" 2> $TMP/reply
  315.  if [ $? = 1 -o $? = 255 ]; then
  316.   exit
  317.  fi
  318.  REPLY="`cat $TMP/reply`"
  319.  rm -f $TMP/reply
  320.  if [ "$REPLY" = "skip" ]; then
  321.   exit
  322.  elif [ "$REPLY" = "simple" ]; then
  323.   # Do simple LILO setup
  324.   simplelilo
  325.   exit
  326.  fi
  327.  # drop through to last option: (use the expert menus)
  328.  while [ 0 ]; do
  329.   dialog --title "EXPERT LILO INSTALLATION" --menu \
  330. "This menu directs the creation of the LILO config file, lilo.conf. \
  331. To install, you make a new LILO configuration file by creating a new header \
  332. and then adding one or more bootable partitions to the file. Once you've done \
  333. this, you can select the install option. Alternately, if you already have an \
  334. /etc/lilo.conf, you may reinstall using that. If you make a mistake, you can \
  335. always start over by choosing 'Begin'. \
  336. Which option would you like?" 22 73 9 \
  337. "Begin" "Start LILO configuration with a new LILO header" \
  338. "Linux" "Add a Linux partition to the LILO config file" \
  339. "OS/2" "Add an OS/2 partition to the LILO config file" \
  340. "DOS" "Add a DOS partition to the LILO config file" \
  341. "Install" "Install LILO" \
  342. "Recycle" "Reinstall LILO using the existing lilo.conf" \
  343. "Skip" "Skip LILO installation and exit this menu" \
  344. "View" "View your current /etc/lilo.conf" \
  345. "Help" "Read the Linux Loader HELP file"  2> $TMP/reply
  346.   if [ $? = 1 -o $? = 255 ]; then
  347.    REPLY="Skip"
  348.   else
  349.    REPLY="`cat $TMP/reply`"
  350.   fi
  351.   rm -r $TMP/reply
  352.   if [ "$REPLY" = "Begin" ]; then
  353.    dialog --title "OPTIONAL append= LINE" --inputbox "Some systems might \
  354. require extra parameters to be passed to the kernel in order to boot. An \
  355. example would be the hd=cyl,hds,secs needed with some SCSI systems and some \
  356. machines with IBM motherboards. If you \
  357. needed to pass parameters to the kernel when you booted the Slackware \
  358. bootkernel disk, you'll probably want to enter the same ones here. Most \
  359. systems won't require any extra parameters. If you don't need any, just \
  360. hit ENTER to continue." 14 72 2> $TMP/reply
  361.    if [ $? = 1 -o $? = 255 ]; then
  362.     HDR="no"
  363.     continue;
  364.    else
  365.     APPEND="`cat $TMP/reply`"
  366.    fi
  367.    dialog --title "SELECT LILO TARGET LOCATION" --menu "LILO can be installed \
  368. to a variety of places: the master boot record of your first hard drive, the \
  369. superblock of your root Linux partition (which could then be made the \
  370. bootable partition with fdisk), or a formatted floppy disk. If you're using \
  371. a boot system such as OS/2's Boot Manager, you should use the "Root" \
  372. selection. Please pick a target location:" 16 65 3 \
  373. "MBR" "Use the Master Boot Record" \
  374. "Root" "Use superblock of the root Linux partition" \
  375. "Floppy" "Use a formatted floppy disk in the boot drive" 2> $TMP/reply
  376.    if [ $? = 1 -o $? = 255 ]; then
  377.     HDR="no"
  378.     continue;
  379.    else
  380.     LNX="no"
  381.     TG="`cat $TMP/reply`"
  382.    fi
  383.    rm -r $TMP/reply
  384.    if [ "$TG" = "MBR" ]; then
  385.     if [ -L $T_PX/dev/hda ]; then
  386.      LILO_TARGET="/dev/sda"
  387.     elif probe /dev/hda; then
  388.      CDROM_LINK=`/bin/ls -l $T_PX/dev/cdrom`
  389.      CDROM_LINK=`echo $CDROM_LINK | cut -f 11 -d ' '`
  390.      if [ "$CDROM_LINK" = "/dev/hda" -o "$CDROM_LINK" = "hda" ]; then
  391.       LILO_TARGET="/dev/sda" # It must be sda, if there's a CDROM on hda.
  392.      else
  393.       LILO_TARGET="/dev/hda"
  394.      fi
  395.     elif probe /dev/sda; then
  396.      LILO_TARGET="/dev/sda"
  397.     else
  398.      dialog --msgbox "LILO can't find your first hard drive! Sorry, \
  399. but LILO is getting /dev/null'ed..." 10 50
  400.      LILO_TARGET="/dev/null"
  401.     fi
  402.    elif [ "$TG" = "Root" ]; then
  403.     LILO_TARGET=`echo $ROOT_DEVICE` # Here, we use the partition superblock for OS/2 Boot Manager
  404.    elif [ "$TG" = "Floppy" ]; then
  405.     LILO_TARGET="/dev/fd0"    
  406.    else
  407.     HDR="no"
  408.     continue;
  409.    fi
  410.    dialog --title "CHOOSE LILO DELAY" --menu "How long would you like \
  411. LILO to wait for you to hit left-shift to get a prompt after rebooting? If you \
  412. let LILO time out, it will boot the first OS in the configuration file by \
  413. default." 13 72 4 \
  414. "None" "Don't wait at all - boot straight into the first OS" \
  415. "5" "5 seconds" \
  416. "30" "30 seconds" \
  417. "Forever" "Present a prompt and wait until a choice is made" 2> $TMP/reply
  418.    if [ $? = 1 -o $? = 255 ]; then
  419.     HDR="no"
  420.     continue;
  421.    else
  422.     DELAY="`cat $TMP/reply`"
  423.    fi
  424.    rm -r $TMP/reply
  425.    if [ "$DELAY" = "None" ]; then 
  426.     DELAY="# delay = 5"
  427.    elif [ "$DELAY" = "5" ]; then
  428.     DELAY="delay = 50"
  429.    elif [ "$DELAY" = "30" ]; then
  430.     DELAY="delay = 300" 
  431.    elif [ "$DELAY" = "Forever" ]; then
  432.     DELAY="prompt"
  433.    else
  434.     HDR="no"
  435.     continue;
  436.    fi
  437.    if [ "$APPEND" = "" ]; then
  438.     cat << EOF > $TMP/lilo.conf
  439. # LILO configuration file
  440. # generated by 'liloconfig'
  441. #
  442. # Start LILO global section
  443. boot = $LILO_TARGET
  444. #compact        # faster, but won't work on all systems.
  445. $DELAY
  446. vga = normal    # force sane state
  447. # ramdisk = 0     # paranoia setting
  448. # End LILO global section
  449. EOF
  450.     HDR="yes"
  451.    else
  452.     cat << EOF > $TMP/lilo.conf
  453. # LILO configuration file
  454. # generated by 'liloconfig'
  455. #
  456. # Start LILO global section
  457. append="$APPEND"
  458. boot = $LILO_TARGET
  459. #compact        # faster, but won't work on all systems.
  460. $DELAY
  461. vga = normal    # force sane state
  462. # ramdisk = 0     # paranoia setting
  463. # End LILO global section
  464. EOF
  465.     HDR="yes"
  466.    fi
  467.   elif [ "$REPLY" = "Linux" ]; then
  468.    if [ "$HDR" = "yes" ]; then
  469.     echo "These are your Linux partitions:" > $TMP/tmpmsg
  470.     echo >> $TMP/tmpmsg
  471.     echo "   Device Boot  Begin   Start    End  Blocks   Id  System" >> $TMP/tmpmsg
  472.     $PROBE -l | fgrep Linux | fgrep native >> $TMP/tmpmsg
  473.     echo >> $TMP/tmpmsg
  474.     echo "Which one would you like LILO to boot?" >> $TMP/tmpmsg
  475.     dialog --title "SELECT LINUX PARTITION" --inputbox \
  476. "`cat $TMP/tmpmsg`" 20 74 2> $TMP/reply
  477.     if [ $? = 1 -o $? = 255 ]; then
  478.      rm $TMP/tmpmsg
  479.      continue
  480.     fi
  481.     rm $TMP/tmpmsg
  482.     LINUX_PART="`cat $TMP/reply`"
  483.     checkp_dialog $LINUX_PART
  484.     if [ ! $? = 0 ]; then
  485.      continue;
  486.     fi
  487.     dialog --title "SELECT PARTITION NAME" --inputbox \
  488. "Now you must select a short, unique name for this partition. \
  489. You'll use this name if you specify a partition to boot at the \
  490. LILO prompt. 'Linux' might not be a bad choice. THIS MUST BE A \
  491. SINGLE WORD." 11 60 2> $TMP/reply
  492.     if [ $? = 1 -o $? = 255 ]; then
  493.      continue
  494.     fi
  495.     LABEL="`cat $TMP/reply`"
  496.     cat << EOF >> $TMP/lilo.conf
  497. # Linux bootable partition config begins
  498. image = /vmlinuz
  499.   root = $LINUX_PART
  500.   label = $LABEL
  501.   read-only # Non-UMSDOS filesystems should be mounted read-only for checking
  502. # Linux bootable partition config ends
  503. EOF
  504.    else
  505.     dialog --title "CAN'T ADD LINUX PARTITION" --msgbox "You can't add \
  506. partitions unless you start over with a new LILO header." 6 60
  507.     continue
  508.    fi
  509.    LNX="yes"
  510.   elif [ "$REPLY" = "OS/2" ]; then
  511.    if [ "$HDR" = "yes" ]; then
  512.     echo "These are possibly OS/2 partitions. They will be treated" > $TMP/tmpmsg
  513.     echo "as such if you install them using this menu." >> $TMP/tmpmsg
  514.     echo >> $TMP/tmpmsg
  515.     echo "   Device Boot  Begin   Start    End  Blocks   Id  System" >> $TMP/tmpmsg
  516.     $PROBE -l | fgrep DOS >> $TMP/tmpmsg
  517.     $PROBE -l | fgrep HPFS >> $TMP/tmpmsg
  518.     echo >> $TMP/tmpmsg
  519.     echo "Which one would you like LILO to boot?" >> $TMP/tmpmsg
  520.     dialog --title "SELECT OS/2 PARTITION" --inputbox \
  521. "`cat $TMP/tmpmsg`" 20 74 2> $TMP/reply
  522.     if [ $? = 1 -o $? = 255 ]; then
  523.      rm $TMP/tmpmsg
  524.      continue
  525.     fi
  526.     rm $TMP/tmpmsg
  527.     OS_2_PART="`cat $TMP/reply`"
  528.     checkp_dialog $OS_2_PART
  529.     if [ ! $? = 0 ]; then
  530.      continue;
  531.     fi
  532.     dialog --title "SELECT PARTITION NAME" --inputbox \
  533. "Now you must select a short, unique name for this partition. \
  534. You'll use this name if you specify a partition to boot at the \
  535. LILO prompt. 'OS/2' might not be a bad choice. THIS MUST BE A \
  536. SINGLE WORD."  11 60 2> $TMP/reply
  537.     if [ $? = 1 -o $? = 255 ]; then
  538.      continue
  539.     fi
  540.     LABEL="`cat $TMP/reply`"
  541.     TABLE="`echo $OS_2_PART | cut -b1-8`"
  542.     if [ "`echo $TABLE | cut -b6-8`" = "hda" ]; then
  543.      cat << EOF >> $TMP/lilo.conf
  544. # OS/2 bootable partition config begins
  545. other = $OS_2_PART
  546.   label = $LABEL
  547.   table = $TABLE
  548. # OS/2 bootable partition config ends
  549. EOF
  550.     else
  551.      cat << EOF >> $TMP/lilo.conf
  552. # OS/2 bootable partition config begins
  553. other = $OS_2_PART
  554.   label = $LABEL
  555.   table = $TABLE
  556.   loader = /boot/os2_d.b
  557.   map-drive = 0x80
  558.    to = 0x81
  559.   map-drive = 0x81
  560.    to = 0x80
  561. # OS/2 bootable partition config ends
  562. EOF
  563.     fi
  564.    else
  565.     dialog --title "CAN'T ADD OS/2 PARTITION" --msgbox "You can't add \
  566. partitions unless you start over with a new LILO header." 6 60
  567.     continue
  568.    fi
  569.    LNX="yes"
  570.   elif [ "$REPLY" = "DOS" ]; then
  571.    if [ "$HDR" = "yes" ]; then
  572.     echo "These are possibly DOS partitions. They will be treated" > $TMP/tmpmsg
  573.     echo "as such if you install them using this menu." >> $TMP/tmpmsg
  574.     echo >> $TMP/tmpmsg
  575.     echo "   Device Boot  Begin   Start    End  Blocks   Id  System" >> $TMP/tmpmsg
  576.     $PROBE -l | fgrep DOS >> $TMP/tmpmsg
  577.     echo >> $TMP/tmpmsg
  578.     echo "Which one would you like LILO to boot?" >> $TMP/tmpmsg
  579.     dialog --title "SELECT DOS PARTITION" --inputbox \
  580. "`cat $TMP/tmpmsg`" 20 74 2> $TMP/reply
  581.     if [ $? = 1 -o $? = 255 ]; then
  582.      rm $TMP/tmpmsg
  583.      continue
  584.     fi
  585.     rm $TMP/tmpmsg
  586.     DOSPART="`cat $TMP/reply`"
  587.     checkp_dialog $DOSPART
  588.     if [ ! $? = 0 ]; then
  589.      continue;
  590.     fi
  591.     dialog --title "SELECT PARTITION NAME" --inputbox \
  592. "Now you must select a short, unique name for this partition. \
  593. You'll use this name if you specify a partition to boot at the \
  594. LILO prompt. 'DOS' might not be a bad choice. THIS MUST BE A \
  595. SINGLE WORD." 11 60 2> $TMP/reply
  596.     if [ $? = 1 -o $? = 255 ]; then
  597.      continue
  598.     fi
  599.     LABEL="`cat $TMP/reply`"
  600.     unset USE_LOADER
  601.     TABLE="`echo $DOSPART | cut -b1-8`"
  602.     if [ "`echo $TABLE | cut -b6-8`" = "hda" ]; then
  603.      USE_LOADER="no"
  604.     fi
  605.     if [ "`echo $TABLE | cut -b6-8`" = "sda" ]; then
  606.      if probe /dev/hda; then
  607.       USE_LOADER="yes"
  608.      else
  609.       USE_LOADER="no"
  610.      fi
  611.     fi
  612.     if [ "$USE_LOADER" = "no" ]; then
  613.      cat << EOF >> $TMP/lilo.conf
  614. # DOS bootable partition config begins
  615. other = $DOSPART
  616.   label = $LABEL
  617.   table = $TABLE
  618. # DOS bootable partition config ends
  619. EOF
  620.     else
  621.      cat << EOF >> $TMP/lilo.conf
  622. # DOS bootable partition config begins
  623. other = $DOSPART
  624.   label = $LABEL
  625.   map-drive = 0x80
  626.    to = 0x81
  627.   map-drive = 0x81
  628.    to = 0x80
  629.   table = $TABLE
  630. # DOS bootable partition config ends
  631. EOF
  632.     fi
  633.    else
  634.     dialog --title "CAN'T ADD DOS PARTITION" --msgbox "You can't add \
  635. partitions unless you start over with a new LILO header." 6 60
  636.     continue
  637.    fi
  638.    LNX="yes"
  639.   elif [ "$REPLY" = "Install" -o "$REPLY" = "Recycle" ]; then
  640.    if [ "$REPLY" = "Recycle" -a -r $T_PX/etc/lilo.conf ]; then
  641.     LNX="yes"
  642.    fi
  643.    if [ "$LNX" = "no" ]; then
  644.     dialog --title "CAN'T INSTALL LILO" --msgbox "LILO could not be \
  645. installed. If you have not created a LILO configuration file by defining \
  646. a new header and adding at least one bootable partition to it, you must do \
  647. so before installing LILO. If you were attempting to use an existing LILO \
  648. configuration file, it could not be found. Try making a new one." 9 70
  649.     continue
  650.    else
  651.     if [ "$REPLY" = "Install" ]; then
  652.      if [ -r $TMP/lilo.conf ]; then
  653.       if [ -r $T_PX/etc/lilo.conf ]; then
  654.        mv $T_PX/etc/lilo.conf $T_PX/etc/lilo.conf.bak
  655.       fi
  656.       cp $TMP/lilo.conf $T_PX/etc/lilo.conf
  657.       chmod 644 $T_PX/etc/lilo.conf
  658.      fi
  659.     fi    
  660.     dialog --infobox "\nInstalling the Linux Loader..." 5 40
  661.     if [ "$T_PX" = "/" ]; then
  662.      lilo 1> /dev/null 2> /dev/null
  663.     else
  664.      lilo -r $T_PX -m /boot/map -C /etc/lilo.conf 1> /dev/null 2> /dev/null
  665.     fi
  666.    fi
  667.    rm -f $TMP/tmpmsg $TMP/reply
  668.    break
  669.   elif [ "$REPLY" = "Skip" ]; then
  670.    rm -f $TMP/tmpmsg $TMP/reply
  671.    break
  672.   elif [ "$REPLY" = "View" ]; then
  673.    if [ -r $TMP/lilo.conf ]; then
  674.     dialog --title "YOUR NEW /etc/lilo.conf" --textbox "$TMP/lilo.conf" 22 70
  675.    else
  676.     if [ -r /mnt/etc/lilo.conf ]; then
  677.      dialog --title "YOUR OLD /etc/lilo.conf" --textbox "/mnt/etc/lilo.conf" 22 70
  678.     elif [ "$T_PX" = "/" -a -r /etc/lilo.conf ]; then
  679.      dialog --title "YOUR OLD /etc/lilo.conf" --textbox "/etc/lilo.conf" 22 70
  680.     else
  681.      dialog --title "NO CONFIG FILE FOUND" --msgbox "Sorry, but you don't \
  682. have a LILO configuration file that can be viewed." 6 60
  683.     fi
  684.    fi
  685.   elif [ "$REPLY" = "Help" ]; then
  686.    dialog --title "LILO INSTALLATION HELP" --textbox "$T_PX/usr/log/setup/text.lilohelp" 22 68
  687.   fi
  688.  done
  689. else # don't use color!
  690.  while [ 0 ]; do
  691.   cat << EOF
  692.  
  693. LILO INSTALLATION
  694.  
  695. LILO (the Linux Loader) is the program that allows booting Linux directly from
  696. the hard drive. To install, you make a new LILO configuration file by creating
  697. a new header and then adding at least one bootable partition to the file. Once
  698. you've done this, you can select the install option. Alternately, if you 
  699. already have an /etc/lilo.conf, you may reinstall using that. If you make a
  700. mistake, just select (1) to start over.
  701.  
  702. 1 -- Start LILO configuration with a new LILO header
  703. 2 -- Add a Linux partition to the LILO config file
  704. 3 -- Add an OS/2 partition to the LILO config file
  705. 4 -- Add a DOS partition to the LILO config file
  706. 5 -- Install LILO
  707. 6 -- Reinstall LILO using the existing lilo.conf
  708. 7 -- Skip LILO installation and exit this menu
  709. 8 -- View your current /etc/lilo.conf
  710. 9 -- Read the Linux Loader HELP file
  711.  
  712. EOF
  713. echo -n "Which option would you like (1 - 9)? "
  714.   read REPLY;
  715.   echo
  716.   if [ "$REPLY" = "1" ]; then
  717.    cat << EOF
  718. OPTIONAL append="" LINE
  719.  
  720. Some systems might require extra parameters to be passed to the kernel in order
  721. to boot. An example would be the hd=cyl,hds,secs needed with some SCSI systems
  722. and some machines with IBM motherboards. If you needed to pass parameters to the
  723. kernel when you booted the Slackware bootkernel disk, you'll probably want to
  724. enter the same ones here. 
  725.  
  726. Most systems won't require any extra parameters. If you don't need any, just
  727. hit ENTER to continue.
  728.  
  729. EOF
  730.    echo -n "Enter extra parameters==> "
  731.    read APPEND;
  732.    echo
  733.    cat << EOF
  734. SELECT LILO TARGET LOCATION
  735.  
  736. LILO can be installed to a variety of places: 
  737.  1. The Master Boot Record of your first hard drive
  738.  2. The superblock of your root Linux partition (which could then
  739.     be made the bootable partition with fdisk)
  740.  3. A formatted floppy disk
  741.  
  742. If you're using a boot system such as OS/2's Boot Manager, you should install
  743. LILO on the superblock of your root Linux partition.
  744.  
  745. EOF
  746.    echo -n "Please pick a target location (1 - 3): "
  747.    read TG;
  748.    echo
  749.    if [ "$TG" = "1" ]; then
  750.     if [ -L $T_PX/dev/hda ]; then
  751.      LILO_TARGET="/dev/sda"
  752.     elif probe /dev/hda; then
  753.      LILO_TARGET="/dev/hda"
  754.     elif probe /dev/sda; then
  755.      LILO_TARGET="/dev/sda"
  756.     else
  757.      cat << EOF
  758. ***** ERROR probing for first hard drive.
  759.  
  760. LILO can't find your first hard drive! Sorry, but LILO is 
  761. getting /dev/null'ed...
  762. EOF
  763.      LILO_TARGET="/dev/null"
  764.     fi
  765.    elif [ "$TG" = "2" ]; then
  766.     LILO_TARGET=`echo $ROOT_DEVICE` # Here, we use the partition superblock for OS/2 Boot Manager
  767.    elif [ "$TG" = "3" ]; then
  768.     LILO_TARGET="/dev/fd0"    
  769.    else
  770.     HDR="no"
  771.     continue;
  772.    fi
  773.    cat << EOF
  774. CHOOSE LILO DELAY
  775.  
  776. How long would you like LILO to wait for you to hit left-shift to 
  777. get a prompt after rebooting? If you let LILO time out, it will boot
  778. the first OS in the configuration file by default.
  779.  
  780. 1 -- None, don't wait at all - boot straight into the first OS
  781. 2 -- 5 seconds
  782. 3 -- 30 seconds
  783. 4 -- Present a prompt and wait until a choice is made without timing out
  784.  
  785. EOF
  786.    echo -n "Which choice would you like (1 - 4)? "
  787.    read DELAY;
  788.    echo
  789.    if [ "$DELAY" = "1" ]; then 
  790.     DELAY="# delay = 5"
  791.    elif [ "$DELAY" = "2" ]; then
  792.     DELAY="delay = 50"
  793.    elif [ "$DELAY" = "3" ]; then
  794.     DELAY="delay = 300" 
  795.    elif [ "$DELAY" = "4" ]; then
  796.     DELAY="prompt"
  797.    else
  798.     HDR="no"
  799.     continue;
  800.    fi
  801.    if [ "$APPEND" = "" ]; then
  802.     cat << EOF > $TMP/lilo.conf
  803. # LILO configuration file
  804. # generated by 'liloconfig'
  805. #
  806. # Start LILO global section
  807. boot = $LILO_TARGET
  808. #compact        # faster, but won't work on all systems.
  809. $DELAY
  810. vga = normal    # force sane state
  811. # ramdisk = 0     # paranoia setting
  812. # End LILO global section
  813. EOF
  814.     HDR="yes"
  815.    else
  816.     cat << EOF > $TMP/lilo.conf
  817. # LILO configuration file
  818. # generated by 'liloconfig'
  819. #
  820. # Start LILO global section
  821. append="$APPEND"
  822. boot = $LILO_TARGET
  823. #compact        # faster, but won't work on all systems.
  824. $DELAY
  825. vga = normal    # force sane state
  826. # ramdisk = 0     # paranoia setting
  827. # End LILO global section
  828. EOF
  829.     HDR="yes"
  830.    fi
  831.   elif [ "$REPLY" = "2" ]; then
  832.    if [ "$HDR" = "yes" ]; then
  833.     while [ 0 ]; do
  834.      cat << EOF
  835. SELECT LINUX PARTITION
  836.  
  837. These are your Linux partitions:
  838.  
  839.    Device Boot  Begin   Start    End  Blocks   Id  System
  840. `fdisk -l | fgrep Linux | fgrep native` 
  841.  
  842. EOF
  843.      echo -n "Which one would you like LILO to boot? "
  844.      read LINUX_PART;
  845.      checkp_text $LINUX_PART
  846.      if [ $? = 0 ]; then
  847.       break;
  848.      fi
  849.     done
  850.     echo
  851.     cat << EOF
  852. SELECT PARTITION NAME
  853.  
  854. Now you must select a short, unique name for this partition. 
  855. You'll use this name if you specify a partition to boot at the 
  856. LILO prompt. 'Linux' might not be a bad choice.
  857.  
  858. THIS MUST BE A SINGLE WORD.
  859.  
  860. EOF
  861.     echo -n "Enter name: "
  862.     read LABEL;
  863.     cat << EOF >> $TMP/lilo.conf
  864. # Linux bootable partition config begins
  865. image = /vmlinuz
  866.   root = $LINUX_PART
  867.   label = $LABEL
  868.   read-only # Non-UMSDOS filesystems should be mounted read-only for checking
  869. # Linux bootable partition config ends
  870. EOF
  871.    else
  872.     cat << EOF
  873. CAN'T ADD LINUX PARTITION
  874.  
  875. You can't add partitions unless you start over
  876. with a new LILO header.
  877.  
  878. EOF
  879.     echo -n "Press ENTER to continue."
  880.     read JUNK;
  881.     echo
  882.     continue
  883.    fi
  884.    LNX="yes"
  885.   elif [ "$REPLY" = "3" ]; then
  886.    if [ "$HDR" = "yes" ]; then
  887.     while [ 0 ]; do
  888.      cat << EOF
  889. SELECT OS/2 PARTITION
  890.  
  891. These are possibly OS/2 partitions. They will be treated
  892. as such if you install them using this menu.
  893.  
  894.    Device Boot  Begin   Start    End  Blocks   Id  System
  895. `fdisk -l | fgrep DOS`
  896. `fdisk -l | fgrep HPFS`
  897.  
  898. EOF
  899.      echo -n "Which one would you like LILO to boot? "
  900.      read OS_2_PART; 
  901.      checkp_text $OS_2_PART
  902.      if [ $? = 0 ]; then
  903.       break;
  904.      fi
  905.     done
  906.     echo
  907.     cat << EOF
  908. SELECT PARTITION NAME
  909.  
  910. Now you must select a short, unique name for this partition. 
  911. You'll use this name if you specify a partition to boot at the
  912. LILO prompt. 'OS/2' might not be a bad choice.
  913.  
  914. THIS MUST BE A SINGLE WORD.
  915.  
  916. EOF
  917.     echo -n "Enter name: "
  918.     read LABEL;
  919.     echo
  920.     TABLE="`echo $OS_2_PART | cut -b1-8`"
  921.     if [ "`echo $TABLE | cut -b6-8`" = "hda" ]; then
  922.      cat << EOF >> $TMP/lilo.conf
  923. # OS/2 bootable partition config begins
  924. other = $OS_2_PART
  925.   label = $LABEL
  926.   table = $TABLE
  927. # OS/2 bootable partition config ends
  928. EOF
  929.     else
  930.      cat << EOF >> $TMP/lilo.conf
  931. # OS/2 bootable partition config begins
  932. other = $OS_2_PART
  933.   label = $LABEL
  934.   table = $TABLE
  935.   loader = /boot/os2_d.b
  936.   map-drive = 0x80
  937.    to = 0x81
  938.   map-drive = 0x81
  939.    to = 0x80
  940. # OS/2 bootable partition config ends
  941. EOF
  942.     fi
  943.    else
  944.     cat << EOF
  945. CAN'T ADD OS/2 PARTITION
  946.  
  947. You can't add partitions unless you start over
  948. with a new LILO header.
  949.  
  950. EOF
  951.     echo -n "Press ENTER to continue."
  952.     read JUNK;
  953.     echo
  954.     continue
  955.    fi
  956.    LNX="yes"
  957.   elif [ "$REPLY" = "4" ]; then
  958.    if [ "$HDR" = "yes" ]; then
  959.     while [ 0 ]; do
  960.      cat << EOF
  961. SELECT DOS PARTITION
  962.  
  963. These are possibly DOS partitions. They will be treated
  964. as such if you install them using this menu.
  965.  
  966.    Device Boot  Begin   Start    End  Blocks   Id  System"
  967. `fdisk -l | fgrep DOS`
  968.  
  969. EOF
  970.      echo -n "Which one would you like LILO to boot? "
  971.      read DOSPART;
  972.      checkp_text $DOSPART
  973.      if [ $? = 0 ]; then
  974.       break;
  975.      fi
  976.     done
  977.     cat << EOF
  978.  
  979. SELECT PARTITION NAME
  980.  
  981. Now you must select a short, unique name for this partition. 
  982. You'll use this name if you specify a partition to boot at the 
  983. LILO prompt. 'DOS' might not be a bad choice.
  984.  
  985. THIS MUST BE A SINGLE WORD.
  986.  
  987. EOF
  988.     echo -n "Enter name: "
  989.     read LABEL;
  990.     echo
  991.     TABLE="`echo $DOSPART | cut -b1-8`"
  992.     unset USE_LOADER
  993.     if [ "`echo $TABLE | cut -b6-8`" = "hda" ]; then
  994.      USE_LOADER="no"
  995.     fi
  996.     if [ "`echo $TABLE | cut -b6-8`" = "sda" ]; then
  997.      if probe /dev/hda; then
  998.       USE_LOADER="yes"
  999.      else
  1000.       USE_LOADER="no"
  1001.      fi
  1002.     fi
  1003.     if [ "$USE_LOADER" = "no" ]; then
  1004.      cat << EOF >> $TMP/lilo.conf
  1005. # DOS bootable partition config begins
  1006. other = $DOSPART
  1007.   label = $LABEL
  1008.   table = $TABLE
  1009. # DOS bootable partition config ends
  1010. EOF
  1011.     else
  1012.      cat << EOF >> $TMP/lilo.conf
  1013. # DOS bootable partition config begins
  1014. other = $DOSPART
  1015.   label = $LABEL
  1016.   map-drive = 0x80
  1017.    to = 0x81
  1018.   map-drive = 0x81
  1019.    to = 0x80
  1020.   table = $TABLE
  1021. # DOS bootable partition config ends
  1022. EOF
  1023.     fi
  1024.    else
  1025.     cat << EOF
  1026. CAN'T ADD DOS PARTITION
  1027.  
  1028. You can't add partitions unless you start over
  1029. with a new LILO header.
  1030.  
  1031. EOF
  1032.     echo -n "Press ENTER to continue."
  1033.     read JUNK;
  1034.     echo
  1035.     continue
  1036.    fi
  1037.    LNX="yes"
  1038.   elif [ "$REPLY" = "5" -o "$REPLY" = "6" ]; then
  1039.    if [ "$REPLY" = "6" -a -r $T_PX/etc/lilo.conf ]; then
  1040.     LNX="yes"
  1041.    fi
  1042.    if [ "$LNX" = "no" ]; then
  1043.     cat << EOF
  1044. CAN'T INSTALL LILO
  1045.  
  1046. LILO could not be installed. If you have not created a LILO 
  1047. configuration file by defining a new header and adding at least
  1048. one bootable partition to it, you must do so before installing
  1049. LILO. If you were attempting to use an existing LILO configuration
  1050. file, it could not be found. Try making a new one.
  1051.  
  1052. EOF
  1053.     echo -n "Press ENTER to continue."
  1054.     read JUNK;
  1055.     echo
  1056.     continue
  1057.    else
  1058.     if [ "$REPLY" = "5" ]; then
  1059.      if [ -r $TMP/lilo.conf ]; then
  1060.       if [ -r $T_PX/etc/lilo.conf ]; then
  1061.        mv $T_PX/etc/lilo.conf $T_PX/etc/lilo.conf.bak
  1062.       fi
  1063.       cp $TMP/lilo.conf $T_PX/etc/lilo.conf
  1064.       chmod 644 $T_PX/etc/lilo.conf
  1065.      fi
  1066.     fi    
  1067.     echo
  1068.     echo "Installing the Linux Loader..." 
  1069.     if [ "$T_PX" = "/" ]; then
  1070.      lilo
  1071.     else
  1072.      lilo -r $T_PX -m /boot/map -C /etc/lilo.conf
  1073.     fi
  1074.    fi
  1075.    rm -f $TMP/tmpmsg $TMP/reply
  1076.    break
  1077.   elif [ "$REPLY" = "7" ]; then
  1078.    rm -f $TMP/tmpmsg $TMP/reply
  1079.    break
  1080.   elif [ "$REPLY" = "8" ]; then
  1081.    if [ -r $TMP/lilo.conf ]; then
  1082.     if [ -r /bin/more ]; then
  1083.      cat $TMP/lilo.conf | more
  1084.     else
  1085.      cat $TMP/lilo.conf
  1086.     fi
  1087.     echo -n "Press ENTER to continue..."
  1088.     read JUNK;
  1089.     echo
  1090.    else
  1091.     if [ -r /mnt/etc/lilo.conf ]; then
  1092.      if [ -r /bin/more ]; then
  1093.       cat /mnt/etc/lilo.conf | more
  1094.      else
  1095.       cat /mnt/etc/lilo.conf
  1096.      fi
  1097.      echo -n "Press ENTER to continue..."
  1098.      read JUNK;
  1099.      echo
  1100.     elif [ "$T_PX" = "/" -a -r /etc/lilo.conf ]; then
  1101.      if [ -r /bin/more ]; then
  1102.       cat /etc/lilo.conf | more
  1103.      else
  1104.       cat /etc/lilo.conf
  1105.      fi
  1106.      echo -n "Press ENTER to continue..."
  1107.      read JUNK;
  1108.      echo
  1109.     else
  1110.      cat << EOF
  1111.  
  1112. NO CONFIG FILE FOUND
  1113.  
  1114. Sorry, but you don't have a LILO configuration file that can be viewed.
  1115.  
  1116. EOF
  1117.      echo -n "Press ENTER to continue..."
  1118.      read JUNK;
  1119.      echo
  1120.     fi
  1121.    fi
  1122.   elif [ "$REPLY" = "9" ]; then
  1123.    if [ -r /bin/more ]; then
  1124.     cat $T_PX/usr/log/setup/text.lilohelp | more
  1125.    else 
  1126.     cat $T_PX/usr/log/setup/text.lilohelp 
  1127.     echo -n "Sorry... there's no pager on this disk. Press ENTER to continue."
  1128.     read JUNK;
  1129.     echo
  1130.    fi
  1131.   fi
  1132.  done
  1133.  echo
  1134. fi # are we using color?
  1135.